import random
import string
from datetime import datetime

class OrderNumber:
    def generate_order_number(self):
        timestamp = datetime.now().strftime('%Y%m%d%H%M%S')  # 获取当前时间戳，格式化为 YYYYMMDDHHMMSS
        random_str = ''.join(random.choices(string.ascii_uppercase + string.digits, k=6))  # 生成 6 位随机字符（字母 + 数字）
        order_number = f"ORD{timestamp}{random_str}"
        return order_number